﻿using NUnit.Framework;

namespace PriceCalculator.Tests
{
  [TestFixture]
  public class CalcPriceWithoutExpectedDiscount
  {
    [Test]
    public void Empty()
    {
      var input = new int[0];
      var expected = 0;

      var result = Calculator.CalcPrice(input);

      Assert.That(result, Is.EqualTo(expected));
    }

    [Test]
    public void OnlyOneBook()
    {
      var input = new[] { 1 };
      var expected = 1 * 8.0;

      var result = Calculator.CalcPrice(input);

      Assert.That(result, Is.EqualTo(expected));
    }

    [Test]
    public void FourBooksWithSameTitle()
    {
      var input = new [] { 4 };
      var expected = 4 * 8.0;

      var result = Calculator.CalcPrice(input);

      Assert.That(result, Is.EqualTo(expected));
    }

    [Test]
    public void ThreeSameBooksButNoOthers()
    {
      var input = new[] { 3, 0, 0, 0 };
      var expected = 3 * 8.0;

      var result = Calculator.CalcPrice(input);

      Assert.That(result, Is.EqualTo(expected));
    }

  }
}
